package com.atguigu.gmall.feign.cart;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RequestMapping("/api/cart")
@FeignClient("service-cart")
public interface CartFeignClient {

    @GetMapping("/addToCart")
    CartInfo addToCart(@RequestParam("skuId") Long skuId,
                       @RequestParam("skuNum") Integer skuNum);

    /*    @GetMapping("/listCart")
        public List<CartInfo> listCart();*/

    @GetMapping("/cartListChecked")
    List<CartInfo> cartListChecked();

    /**
     * json
     * @param skuIds
     * @return
     */
    @DeleteMapping("/deleteSku")
    Result deleteSkuFromCart(@RequestBody List<Long> skuIds);
}
